package cn.ruituo.adv2;
import java.util.*;
public class TreeSetTest {
    public static void main(String[] args) {
        Set<Pengiun> set=new TreeSet<>();
        //TreeSet要求对象可比较。。。
        set.add(new Pengiun("大花",3,"帝企鹅"));
        set.add(new Pengiun("二花",2,"帝企鹅"));
        set.add(new Pengiun("小花",1,"小黄企鹅"));
        set.add(new Pengiun("小花",15,"小蓝企鹅"));
        //set.add(null);
        System.out.println("size:"+set.size());
        for(Pengiun p:set)
            System.out.println(p);
    }
}
